package edu.mit.media.fv.aqview
{
	import edu.mit.media.fv.components.AQCircleButton2;
	import edu.mit.media.fv.components.AQTextArea;
	import edu.mit.media.fv.components.AQTextField;
	import edu.mit.media.fv.aqwidgets.*;
	
	import flash.display.MovieClip;
	import edu.mit.media.fv.blocks.*;
	import edu.mit.media.fv.components.*;
	import edu.mit.media.fv.events.*;
	import edu.mit.media.fv.fluidspace.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.text.*;
	public class AQPixViewer extends AQViewer
	{
		//var tags:AQTextField;
		//var sender:AQTextField;
		//var date:AQTextField;
		//var sendButton:DisplayObject;
		//var goodButton:DisplayObject;
		//var badButton:DisplayObject;
		
		public function AQPixViewer()
		{
			super();
			
			this.goodButton.addEventListener(MouseEvent.CLICK, processGood);
			this.badButton.addEventListener(MouseEvent.CLICK, processBad);
			this.sendButton.addEventListener(MouseEvent.CLICK, replyMessage);

			FluidEventHandler.addEventListener(DisplayEvent.OPEN_PIX, displayWidget);
		}
		private function replyMessage(event:MouseEvent):void{
			var e:WidgetEvent = new WidgetEvent(WidgetEvent.DISPLAY_TEXT_BUILDER);
			e.subject = this.tags.text;
			e.id = this.id;
			FluidEventHandler.dispatchEvent(e);
		}
		
		public function displayWidget(event:DisplayEvent):void{
			FluidEventHandler.dispatchEvent(new WidgetEvent(WidgetEvent.DISPLAY_WIDGET, this, "Picture Messaging"));
			
			this.tags.text = event.subject;
			this.sender.text = event.sourceName;
			this.date.text = event.date;
			this.id = event.id;
		}
		
	}
}